#!/bin/ksh
#
# This program will launch an aixterm/xterm depending on operating system.
# It will than telnet into the machine specified.
#
# Parameters: name of machine to telnet into
#
# Usage: wsmxterminal machine
#

# Check that an argument was given
#echo "Entering script" >>/tmp/myterm
if [ $# -ne 1 ]; then
  echo Usage: $0 machine
  exit 1
fi



  OS=`/bin/uname -s`

  if [ -x /usr/bin/X11/aixterm ] ; then
    TERMINAL=/usr/bin/X11/aixterm
  else
    TERMINAL=/usr/bin/X11/xterm
  fi



  COMMAND="export TERM=vt220 ; \
echo $1; \
telnet $1 ; \
echo Hit enter to continue ...\\\\c;\
read x"



nohup $TERMINAL -T $1 -e /bin/ksh -c "$COMMAND" >>/dev/null 2>&1  &


